#Make HTML/JS for wrapper
grunt --gruntfile Gruntfile-SG.js wrapper-package

#clean www folders
rm -R ./BMWWrapper/www/*
rm -R ./BMWWrapperAndroid/assets/www/*

# copy files to wrapper folder
cp -R ./dist/. ./BMWWrapper/www
cp -R ./dist/. ./BMWWrapperAndroid/assets/www

#Build iOS application
cd BMWWRapper
ipa build -p BMWWRapper.xcodeproj -s BMWWRapper -c Release
mv BMWWRapper.ipa ../out/BMWWRapper-IN.ipa
cd ..

#Build Android application
cd BMWWrapperAndroid
ant debug
mv bin/BMWWrapper-debug.apk ../out/BMWWrapper-IN.apk

